package com.ldf.jrtsp.rtcp;

import cn.hutool.core.util.ByteUtil;

/**
 * rtcp byte数据包构建
 *
 * @author lidaofu
 * @since 2024/6/24
 **/
public class ReceiverReportRtcpDataPacket implements IRtcpDataPacket {
    private static byte[] byeData = new byte[]{(byte) 0x80, (byte) 0xC9,0x00,0x01,0x00,0x00,0x00,0x00};

    @Override
    public byte[] build(String ssrc) {
        byte[] bytes = ByteUtil.longToBytes(Long.parseLong(ssrc, 16));
        System.arraycopy(bytes, 0, byeData, 3, 4);
        return byeData;
    }
}
